package com.github.permissiondog.cancanpandroid.model;


import androidx.annotation.NonNull;

public class TableTemplate {
    private int id;
    private int creatorId;
    private String tableName;
    private String description;
    private String creationTime;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(int creatorId) {
        this.creatorId = creatorId;
    }

    public String getTableName() {
        return tableName.replace("课程申请: ", "");
    }

    public boolean isCourse() {
        return tableName.startsWith("课程申请: ");
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCreationTime() {
        return creationTime;
    }

    public void setCreationTime(String creationTime) {
        this.creationTime = creationTime;
    }

    @NonNull
    @Override
    public String toString() {
        // 作为下拉菜单的值显示
        return getTableName();
    }
}
